<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	
	
	<script type="text/javascript">
		function Xiaoming(name,age,sex,boyfriend){
 		this.name=name;
        this.age=age;
        this.sex=sex;
        this.boyfriend = boyfriend;
        this.friend = function(){
            alert("我叫"+this.name+"，今年"+this.age+"，性别"+this.sex+"，我"+this.boyfriend)
        }
    }
    var obj=new Xiaoming("小明","18","男","没有男朋友");
    obj.friend();
	</script>
</html>
